package co.fitstart.mobile.entity.appointment;

import java.util.Date;

import javax.persistence.Transient;

import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;

import com.demo2do.core.utils.DateFormatUtils;

public class RestCalendarStat {
    
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date day;
    
    private String hour;
    
    private int amount;
    
    /**
     * The default constructor
     */
    public RestCalendarStat() {
    }
    
    public RestCalendarStat(Date day, String hour, Long amount) {
        this.day = day;
        this.hour = hour;
        this.amount = amount.intValue();
    }
    
    /**
     * @return
     */
    @Transient
    public String getDayhour() {
        
        if(this.day != null && StringUtils.isNotBlank(hour)) {
            return DateFormatUtils.format(this.day) + "|" + this.hour; 
        }
        
        return null;
    }
    
    /**
     * @return the day
     */
    public Date getDay() {
        return day;
    }

    /**
     * @return the hour
     */
    public String getHour() {
        return hour;
    }

    /**
     * @return the amount
     */
    public int getAmount() {
        return amount;
    }

    /**
     * @param day the day to set
     */
    public void setDay(Date day) {
        this.day = day;
    }

    /**
     * @param hour the hour to set
     */
    public void setHour(String hour) {
        this.hour = hour;
    }

    /**
     * @param amount the amount to set
     */
    public void setAmount(int amount) {
        this.amount = amount;
    }
}
